package com.mycom.service.impl;

import com.mycom.dao.FormItemDao;
import com.mycom.pojo.FormItem;
import com.mycom.service.FormItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FormItemServiceImpl implements FormItemService {
    @Autowired
    private FormItemDao formItemDao;

    @Override
    public boolean save(FormItem formItem) {
        return formItemDao.save(formItem) > 0 ? true : false;
    }

    @Override
    public List<FormItem> findByFormId(Integer formId) {
        return formItemDao.findByFormId(formId);
    }

    @Override
    public boolean deleteByFormId(Integer formId) {
        return formItemDao.deleteByFormId(formId) >=0 ? true : false;
    }

    @Override
    public boolean update(FormItem formItem) {
        return formItemDao.update(formItem) > 0 ? true : false;
    }

    @Override
    public boolean deleteById(Integer id) {
        return formItemDao.deleteById(id) > 0 ? true : false;
    }
}
